package com.zimin.cloud.wiki.api;

import com.zimin.cloud.mine.pojo.wiki.business.CategoryBO;
import com.zimin.cloud.mine.pojo.wiki.business.EbookBO;
import com.zimin.shared.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

/**
 * @author zimin
 */
@FeignClient(name = IBaseWikiFeign.SERVER_NAME)
public interface ICategoryFeign {

    /**
     * 获取分类列表
     *
     * @param categoryBO 请求参数
     */
    @GetMapping(value = "/wiki/categories")
    Result categoryList(@SpringQueryMap CategoryBO categoryBO);


    /**
     * <p>保存分类</p>
     *
     * @param categoryBO 保存参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-02 18:01:48
     */
    @PostMapping(value = "/wiki/category")
    Result saveCategory(@RequestBody CategoryBO categoryBO);

    /**
     * <p>修改分类</p>
     *
     * @param categoryBO 修改分类参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-02 18:02:03
     */
    @PutMapping(value = "/wiki/category")
    Result updateCategory(@RequestBody CategoryBO categoryBO);

    /**
     * <p>根据ID删除分类</p>
     *
     * @param id 要删除的id
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-02 18:02:21
     */
    @DeleteMapping("/wiki/category/{id}")
    Result removeCategoryById(@PathVariable(value = "id") String id);

    /**
     * <p>获取所有的分类树</p>
     *
     * @param categoryBO 分类对象
     * @return com.zimin.shared.pojo.Result
     * @author zimin
     * @since 2021-11-22 17:36:49
     */
    @GetMapping("/wiki/category/all")
    Result categoryAll(@SpringQueryMap  CategoryBO categoryBO);
}
